package alkaid.oss.local.component;

import org.springframework.core.io.Resource;

/**
 * 文件信息
 *  
 * @author Lucky Yang
 * @since 0.0.1
 */
public final class FileData {
    public final Resource content;
    public final String name;
    public final String contentType;

    private FileData(Resource content, String name, String contentType) {
        this.content = content;
        this.name = name;
        this.contentType = contentType;
    }

    public boolean exists() {
        return content == null ? false : content.exists();
    }

    public static  FileData of(Resource content, String name, String contentType) {
       return new FileData(content, name, contentType);
    }
}
